package fei.zhou.springboot4.demo4;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 描述该类- JPA
 *
 * @author zhoufei
 * @class: TaskService
 * @date 2021/1/20  14:37
 * @Verson 1.0 -2021/1/20  14:37
 * @see
 */
@Component
public class TaskService {
    @Scheduled(fixedRate = 5000) //1
    public void reportCurrentTime() {
        System.out.println("每隔五秒执行一次:AAAA");
    }
    @Scheduled(cron = "*/10 * * * * *"  ) //2
    public void fixTimeExecution(){
        System.out.println("" +"每隔10秒执行一次:BBBB");
    }
}